package spring_test;

import javax.annotation.PostConstruct;

public class Bird {
	private int id;
	private String name;
	private Bird.Swing swing;
	
	public Bird()		{}
	
	public Bird(int id, String name)		{
		this.id = id;
		this.name = name;
		this.swing = new Swing();
	}

	public static Bird createBird(int id, String name)		{
		Bird bird = new Bird();
		bird.setId(id);
		bird.setName(name);
		bird.setSwing(new Swing());
		return bird;
	}
	
	public void initCheck()	{
		if(swing == null)		{
			throw new IllegalStateException("judking exception : swing cannot be null");
		}
	}
	
	public Swing getSwing() {
		return swing;
	}
	
//	@Required
	public void setSwing(Bird.Swing swing) {
		this.swing = swing;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	
	public static class Swing {
		private int count;

		public int getCount() {
			return count;
		}

		public void setCount(int count) {
			this.count = count;
		}
	}
}
